package com.ladlee.parking.config;

import com.ladlee.parking.pay.v3.handle.PayHandler;
import com.ladlee.parking.pay.v3.handle.impl.WxWapPayHandler;
import com.ladlee.parking.pay.v3.service.PayService;
import com.ladlee.parking.pay.v3.service.impl.WxPayService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.List;

@Configuration
public class PayConfig {

    /**
     * 注入微信H5支付的处理器
     *
     * @return
     */
    @Bean
    public WxWapPayHandler wxWapPayHandler() {
        return new WxWapPayHandler();
    }

    /**
     * 注入微信支付的service
     *
     * @param handlers
     * @return
     */
    @Bean
    public PayService wxPayService(List<PayHandler> handlers) {
        return new WxPayService(handlers);
    }
}
